﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TMSimulator
{
    public class FileAccess
    {
        DateTime _time;

        public DateTime Time
        {
            get { return _time; }
            set { _time = value; }
        }
        string _userName;

        public string Username
        {
            get { return _userName; }
            set { _userName = value; }
        }
        string _filePath;

        public string FilePath
        {
            get { return _filePath; }
            set { _filePath = value; }
        }
        string _fileAuthor;

        public string FileAuthor
        {
            get { return _fileAuthor; }
            set { _fileAuthor = value; }
        }
        TimeSpan _exposureDuration;

        public TimeSpan ExposureDuration
        {
            get { return _exposureDuration; }
            set { _exposureDuration = value; }
        }
        double _fileExposurePercent;

        public double FileExposurePercent
        {
            get { return _fileExposurePercent; }
            set { _fileExposurePercent = value; }
        }

        public FileAccess(DateTime time, string username, string filepath, string author, TimeSpan span, double exposure)
        {
            Time = time;
            Username = username;
            FilePath = filepath;
            FileAuthor = author;
            ExposureDuration = span;
            FileExposurePercent = exposure;
        }

        public FileAccess(string filepath)
        {

            FilePath = filepath;
        }

        public FileAccess() { }

        public override string ToString()
        {
            var format = "dd/MM/yyyy HH:mm:ss";
            return
                Time.ToString(format) + "," +
                Username + "," +
                FilePath + "," +
                FileAuthor + "," +
                ExposureDuration + "," +
                FileExposurePercent;

        }
    }
}
